package com.rohoo.framework.struts.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;;

public class RefererInterceptor extends AbstractInterceptor{

	public String intercept(ActionInvocation invocation) throws Exception {
		
		ActionContext context = invocation.getInvocationContext();
		
		HttpServletRequest request = (HttpServletRequest)context.get(ServletActionContext.HTTP_REQUEST);
		String referer = request.getHeader("Referer");
		String url = request.getRequestURI();
		
		
		// System.out.println("RefererInterceptor....");
		//System.out.println("refer=" + referer);
		//System.out.println("url=" + url);
		
		return invocation.invoke();
	}
	

}
